package com.saas.sql;

public class MarketQuery
{
  public static String market_INSERT_MARKET = "insert into market(cust_id,area_id,market_name,class_id,money,moneytype,unit,content,oper_time) values(:VCUST_ID,:VAREA_ID,:VMARKET_NAME,:VCLASS_ID,:VMONEY,:VMONEYTYPE,:VUNIT,:VCONTENT,now())";
  public static String market_UPDATE_MARKET = "update market set area_id=:VAREA_ID,market_name=:VMARKET_NAME,class_id=:VCLASS_ID,money=:VMONEY,moneytype=:VMONEYTYPE,unit=:VUNIT,content=:VCONTENT,oper_time=now() where market_id=:VMARKET_ID";
  public static String market_SEL_MARKET_MEM = "select t1.market_id as id,t1.cust_id,t1.market_name,t1.area_id,t1.oper_time,t2.class_name,t3.area_name from market t1,product_class t2,area_info as t3 where t1.class_id=t2.class_id and t1.area_id=t3.area_id and t1.class_id like :VCLASS_ID and market_name like :VMARKET_NAME and t1.cust_id=:VCUST_ID order by t1.oper_time desc";
  public static String market_SEL_MARKET_ADM = "select t1.market_id as id,t1.cust_id,t1.market_name,t1.area_id,t1.oper_time,t2.class_name,t3.area_name from market t1,product_class t2,area_info as t3 where t1.class_id=t2.class_id and t1.area_id=t3.area_id and t1.class_id like :VCLASS_ID and market_name like :VMARKET_NAME order by t1.oper_time desc";
  public static String market_SEL_MARKET_CON = "select t1.*,t2.class_name,t3.area_name from market t1,product_class t2,area_info as t3 where t1.class_id=t2.class_id and t1.area_id=t3.area_id and t1.market_id=:VMARKET_ID";
  public static String market_SEL_PRICELIST = "select t1.class_id,t1.market_name,t1.market_id,t1.money,t1.moneytype,t1.oper_time,t2.class_name , t3.param_name as unit from market t1,product_class t2,data_parameter t3  where t1.class_id=t2.class_id and t1.unit=t3.param_value  and t3.category_id='100010001000119' and t1.class_id like :VCLASS_ID and t1.oper_time between :VSTART and :VEND  order by t1.oper_time desc";
}

